<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class RubyVM::AbstractSyntaxTree::Node - RDoc Documentation</title>


<script src="../../js/navigation.js" defer></script>
<script src="../../js/search.js" defer></script>
<script src="../../js/search_index.js" defer></script>
<script src="../../js/searcher.js" defer></script>
<script src="../../js/darkfish.js" defer></script>

<script src="../../js/jquery-3.2.0.min.js"></script>

<script src="../../js/vue.min.js"></script>
<script src="../../js/js.cookie.min.js"></script>

<link href="../../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../../css/rdoc.css" rel="stylesheet">
<link href="../../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../../";
  var index_rel_prefix = "../../";
  var darkModeCsseHref = "../../css/rdoc-dm.css"
  var defaultModeCssHref = "../../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0-preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../../table_of_contents.html#pages">Pages</a>
    <a href="../../table_of_contents.html#classes">Classes</a>
    <a href="../../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link"><a href="../../Object.html">Object</a>
</div>

        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-i-all_tokens">#all_tokens</a>
    <li ><a href="#method-i-children">#children</a>
    <li ><a href="#method-i-first_column">#first_column</a>
    <li ><a href="#method-i-first_lineno">#first_lineno</a>
    <li ><a href="#method-i-inspect">#inspect</a>
    <li ><a href="#method-i-last_column">#last_column</a>
    <li ><a href="#method-i-last_lineno">#last_lineno</a>
    <li ><a href="#method-i-node_id">#node_id</a>
    <li ><a href="#method-i-script_lines">#script_lines</a>
    <li ><a href="#method-i-source">#source</a>
    <li ><a href="#method-i-tokens">#tokens</a>
    <li ><a href="#method-i-type">#type</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-RubyVM::AbstractSyntaxTree::Node">
    <h1 id="class-RubyVM::AbstractSyntaxTree::Node" class="class">
      class RubyVM::AbstractSyntaxTree::Node
    </h1>

    <section class="description">
    
<p><a href="Node.html"><code>RubyVM::AbstractSyntaxTree::Node</code></a> instances are created by parse methods in <a href="../AbstractSyntaxTree.html"><code>RubyVM::AbstractSyntaxTree</code></a>.</p>

<p>This class is MRI specific.</p>

    </section>

      <section id="5Buntitled-5D" class="documentation-section">





                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-all_tokens" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          all_tokens &rarr; array
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns all tokens for the input script regardless the receiver node. Returns <code>nil</code> if <code>keep_tokens</code> is not enabled when parse method is called.</p>

<pre class="ruby"><span class="ruby-identifier">root</span> = <span class="ruby-constant">RubyVM</span><span class="ruby-operator">::</span><span class="ruby-constant">AbstractSyntaxTree</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-string">&quot;x = 1 + 2&quot;</span>, <span class="ruby-value">keep_tokens:</span> <span class="ruby-keyword">true</span>)
<span class="ruby-identifier">root</span>.<span class="ruby-identifier">all_tokens</span> <span class="ruby-comment"># =&gt; [[0, :tIDENTIFIER, &quot;x&quot;, [1, 0, 1, 1]], [1, :tSP, &quot; &quot;, [1, 1, 1, 2]], ...]</span>
<span class="ruby-identifier">root</span>.<span class="ruby-identifier">children</span>[<span class="ruby-value">-1</span>].<span class="ruby-identifier">all_tokens</span> <span class="ruby-comment"># =&gt; [[0, :tIDENTIFIER, &quot;x&quot;, [1, 0, 1, 1]], [1, :tSP, &quot; &quot;, [1, 1, 1, 2]], ...]</span>
</pre>

                              <div class="method-source-code" id="all_tokens-source">
            <pre><span class="ruby-comment"># File ruby_3_3_0_preview2/ast.rb, line 206</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">all_tokens</span>
  <span class="ruby-constant">Primitive</span>.<span class="ruby-identifier">ast_node_all_tokens</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-children" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          children &rarr; array
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns AST nodes under this one.  Each kind of node has different children, depending on what kind of node it is.</p>

<p>The returned array may contain other nodes or <code>nil</code>.</p>

                              <div class="method-source-code" id="children-source">
            <pre><span class="ruby-comment"># File ruby_3_3_0_preview2/ast.rb, line 217</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">children</span>
  <span class="ruby-constant">Primitive</span>.<span class="ruby-identifier">ast_node_children</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-first_column" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          first_column &rarr; integer
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>The column number in the source code where this AST’s text began.</p>

                              <div class="method-source-code" id="first_column-source">
            <pre><span class="ruby-comment"># File ruby_3_3_0_preview2/ast.rb, line 149</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">first_column</span>
  <span class="ruby-constant">Primitive</span>.<span class="ruby-identifier">ast_node_first_column</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-first_lineno" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          first_lineno &rarr; integer
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>The line number in the source code where this AST’s text began.</p>

                              <div class="method-source-code" id="first_lineno-source">
            <pre><span class="ruby-comment"># File ruby_3_3_0_preview2/ast.rb, line 141</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">first_lineno</span>
  <span class="ruby-constant">Primitive</span>.<span class="ruby-identifier">ast_node_first_lineno</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-inspect" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          inspect &rarr; string
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns debugging information about this node as a string.</p>

                              <div class="method-source-code" id="inspect-source">
            <pre><span class="ruby-comment"># File ruby_3_3_0_preview2/ast.rb, line 225</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">inspect</span>
  <span class="ruby-constant">Primitive</span>.<span class="ruby-identifier">ast_node_inspect</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-last_column" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          last_column &rarr; integer
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>The column number in the source code where this AST’s text ended.</p>

                              <div class="method-source-code" id="last_column-source">
            <pre><span class="ruby-comment"># File ruby_3_3_0_preview2/ast.rb, line 165</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">last_column</span>
  <span class="ruby-constant">Primitive</span>.<span class="ruby-identifier">ast_node_last_column</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-last_lineno" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          last_lineno &rarr; integer
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>The line number in the source code where this AST’s text ended.</p>

                              <div class="method-source-code" id="last_lineno-source">
            <pre><span class="ruby-comment"># File ruby_3_3_0_preview2/ast.rb, line 157</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">last_lineno</span>
  <span class="ruby-constant">Primitive</span>.<span class="ruby-identifier">ast_node_last_lineno</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-node_id" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          node_id &rarr; integer
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns an internal <a href="Node.html#method-i-node_id"><code>node_id</code></a> number. Note that this is an API for ruby internal use, debugging, and research. Do not use this for any other purpose. The compatibility is not guaranteed.</p>

                              <div class="method-source-code" id="node_id-source">
            <pre><span class="ruby-comment"># File ruby_3_3_0_preview2/ast.rb, line 236</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">node_id</span>
  <span class="ruby-constant">Primitive</span>.<span class="ruby-identifier">ast_node_node_id</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-script_lines" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          script_lines &rarr; array
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns the original source code as an array of lines.</p>

<p>Note that this is an API for ruby internal use, debugging, and research. Do not use this for any other purpose. The compatibility is not guaranteed.</p>

                              <div class="method-source-code" id="script_lines-source">
            <pre><span class="ruby-comment"># File ruby_3_3_0_preview2/ast.rb, line 248</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">script_lines</span>
  <span class="ruby-constant">Primitive</span>.<span class="ruby-identifier">ast_node_script_lines</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-source" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          source &rarr; string
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns the code fragment that corresponds to this AST.</p>

<p>Note that this is an API for ruby internal use, debugging, and research. Do not use this for any other purpose. The compatibility is not guaranteed.</p>

<p>Also note that this API may return an incomplete code fragment that does not parse; for example, a here document following an expression may be dropped.</p>

                              <div class="method-source-code" id="source-source">
            <pre><span class="ruby-comment"># File ruby_3_3_0_preview2/ast.rb, line 264</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">source</span>
  <span class="ruby-identifier">lines</span> = <span class="ruby-identifier">script_lines</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">lines</span>
    <span class="ruby-identifier">lines</span> = <span class="ruby-identifier">lines</span>[<span class="ruby-identifier">first_lineno</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span> <span class="ruby-operator">..</span> <span class="ruby-identifier">last_lineno</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>]
    <span class="ruby-identifier">lines</span>[<span class="ruby-value">-1</span>] = <span class="ruby-identifier">lines</span>[<span class="ruby-value">-1</span>][<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-identifier">last_column</span>]
    <span class="ruby-identifier">lines</span>[<span class="ruby-value">0</span>] = <span class="ruby-identifier">lines</span>[<span class="ruby-value">0</span>][<span class="ruby-identifier">first_column</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>]
    <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">join</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-tokens" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          tokens &rarr; array
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns tokens corresponding to the location of the node. Returns <code>nil</code> if <code>keep_tokens</code> is not enabled when parse method is called.</p>

<pre class="ruby"><span class="ruby-identifier">root</span> = <span class="ruby-constant">RubyVM</span><span class="ruby-operator">::</span><span class="ruby-constant">AbstractSyntaxTree</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-string">&quot;x = 1 + 2&quot;</span>, <span class="ruby-value">keep_tokens:</span> <span class="ruby-keyword">true</span>)
<span class="ruby-identifier">root</span>.<span class="ruby-identifier">tokens</span> <span class="ruby-comment"># =&gt; [[0, :tIDENTIFIER, &quot;x&quot;, [1, 0, 1, 1]], [1, :tSP, &quot; &quot;, [1, 1, 1, 2]], ...]</span>
<span class="ruby-identifier">root</span>.<span class="ruby-identifier">tokens</span>.<span class="ruby-identifier">map</span>{<span class="ruby-identifier">_1</span>[<span class="ruby-value">2</span>]}.<span class="ruby-identifier">join</span> <span class="ruby-comment"># =&gt; &quot;x = 1 + 2&quot;</span>
</pre>

<p>Token is an array of:</p>
<ul><li>
<p>id</p>
</li><li>
<p>token type</p>
</li><li>
<p>source code text</p>
</li><li>
<p>location [ <a href="Node.html#method-i-first_lineno"><code>first_lineno</code></a>, <a href="Node.html#method-i-first_column"><code>first_column</code></a>, <a href="Node.html#method-i-last_lineno"><code>last_lineno</code></a>, <a href="Node.html#method-i-last_column"><code>last_column</code></a> ]</p>
</li></ul>

                              <div class="method-source-code" id="tokens-source">
            <pre><span class="ruby-comment"># File ruby_3_3_0_preview2/ast.rb, line 185</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">tokens</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">all_tokens</span>

  <span class="ruby-identifier">all_tokens</span>.<span class="ruby-identifier">each_with_object</span>([]) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">token</span>, <span class="ruby-identifier">a</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">loc</span> = <span class="ruby-identifier">token</span>.<span class="ruby-identifier">last</span>
    <span class="ruby-keyword">if</span> ([<span class="ruby-identifier">first_lineno</span>, <span class="ruby-identifier">first_column</span>] <span class="ruby-operator">&lt;=&gt;</span> [<span class="ruby-identifier">loc</span>[<span class="ruby-value">0</span>], <span class="ruby-identifier">loc</span>[<span class="ruby-value">1</span>]]) <span class="ruby-operator">&lt;=</span> <span class="ruby-value">0</span> <span class="ruby-operator">&amp;&amp;</span>
       ([<span class="ruby-identifier">last_lineno</span>, <span class="ruby-identifier">last_column</span>]   <span class="ruby-operator">&lt;=&gt;</span> [<span class="ruby-identifier">loc</span>[<span class="ruby-value">2</span>], <span class="ruby-identifier">loc</span>[<span class="ruby-value">3</span>]]) <span class="ruby-operator">&gt;=</span> <span class="ruby-value">0</span>
       <span class="ruby-identifier">a</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">token</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-type" class="method-detail ">
                      <div class="method-heading">
                        <span class="method-callseq">
                          type &rarr; symbol
                              </span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns the type of this node as a symbol.</p>

<pre class="ruby"><span class="ruby-identifier">root</span> = <span class="ruby-constant">RubyVM</span><span class="ruby-operator">::</span><span class="ruby-constant">AbstractSyntaxTree</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-string">&quot;x = 1 + 2&quot;</span>)
<span class="ruby-identifier">root</span>.<span class="ruby-identifier">type</span> <span class="ruby-comment"># =&gt; :SCOPE</span>
<span class="ruby-identifier">lasgn</span> = <span class="ruby-identifier">root</span>.<span class="ruby-identifier">children</span>[<span class="ruby-value">2</span>]
<span class="ruby-identifier">lasgn</span>.<span class="ruby-identifier">type</span> <span class="ruby-comment"># =&gt; :LASGN</span>
<span class="ruby-identifier">call</span> = <span class="ruby-identifier">lasgn</span>.<span class="ruby-identifier">children</span>[<span class="ruby-value">1</span>]
<span class="ruby-identifier">call</span>.<span class="ruby-identifier">type</span> <span class="ruby-comment"># =&gt; :OPCALL</span>
</pre>

                              <div class="method-source-code" id="type-source">
            <pre><span class="ruby-comment"># File ruby_3_3_0_preview2/ast.rb, line 133</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">type</span>
  <span class="ruby-constant">Primitive</span>.<span class="ruby-identifier">ast_node_type</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>. </p><p><a href="https://jamesbritt.bandcamp.com/">Hack your world.  Feed your head.  Live curious</a>.</p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

